<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>4 移动端1px问题：请打开手机端查看效果</title>
  <style>
    .box {
      width: 200px;
      height: 50px;
      border-radius: 10px;
      margin-top: 10px;
    }

    .box1 {
      border: 1px solid #000;
    }

    .box2 {
      border: 0.5px solid #000;
    }

    .box3 {
      box-shadow: 0 0 0 .5px #000;
    }

    .box4 {
      position: relative;
    }

    .box4::after {
      content: "";
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      height: 1px;
      /* background-image: linear-gradient(0deg, #000 50%, transparent 50%); */
      background-image: linear-gradient(180deg, red, red 50%, transparent 50%),
        linear-gradient(270deg, red, red 50%, transparent 50%),
        linear-gradient(0deg, red, red 50%, transparent 50%),
        linear-gradient(90deg, red, red 50%, transparent 50%);
    }

    .box5 {
      position: relative;
    }

    .box5::after {
      position: absolute;
      left: 0;
      top: 0;
      content: "";
      width: 200%;
      height: 200%;
      border: 1px solid #f00;
      transform: scale(0.5);
      transform-origin: left top;
      border-radius: 10px;
    }
  </style>
</head>

<body>
  <div class="box box1"> 1px 边框，作为对比 </div>
  <div class="box box2"> 方案1: 直接设置0.5px边框</div>
  <div class="box box3"> 方案2: 设置0.5px阴影扩散半径 </div>
  <div class="box box4"> 方案3: 使用背景渐变实现1px背景的一半</div>
  <div class="box box5"> 方案4: 伪元素2倍尺寸1px边框scale缩小一半</div>
</body>

</html>